home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
LOGIC Apps
/
Logic-APPLE_II_APPS.iso
/
pc
/
LOGIC Apple II 5.25" Library - DOS Part 3
/
DOS069.dsk
/
BLACKJACK STRATEGY.bas
next >
Wrap
BASIC Source File
|
2012-02-16
|
8KB
|
162 lines
0 TEXT
1 REM *** BLACKJACK BASIC STRATEGY ***
2 REM *** BY JERRY HOWARD AS FOUND IN KILOBAUD MICROCOMPUTING SEP 1979
3 REM *** ADAPTED FOR THE APPLE II BY ROBERT J. MATTSON
4 GOTO 20
5 PRINT : PRINT : PRINT : INPUT " PRESS RETURN TO CONTINUE";Q$: RETURN
6 HOME : VTAB 5: RETURN
7 REM *** HERE ARE ALL THE PRACTICE TABLES:
8 REM ** THIS DATA IS A BIT OF A DRAG TO TYPE IN, BUT IT SAVES MANY HOURS IN LEARNING THE STRATEGY !
9 REM ** READ KEYBOARD **
10 NUM = 0:NUM = PEEK( -16384): IF NUM <128 THEN 10
11 POKE -16368,0: RETURN
12 FOR T = 1 TO 3000: NEXT : RETURN
20 DATA 15,9,H,13,5,S,16,8,H,12,4,S,15,2,S,16,5,S,A7,7,S
21 DATA 15,A,H,13,6,S,16,2,S,12,5,S,15,8,H,14,5,S,A7,A,S
25 DIM X(20),A$(20),B$(20),C$(20)
30 DATA 16,9,H,14,7,H,16,10,H,12,6,S,15,10,H,13,3,S,A7,8,S
40 DATA 15,5,S,A4,8,H,16,A,H,12,2,H,15,7,H,13,4,S,A7,10,H
50 DATA 14,10,H,16,6,S,14,5,S,12,3,H,13,A,H,13,2,S,A7,9,H
60 DATA 14,6,S,13,10,H,16,3,S,16,7,H,14,9,H
70 DATA 14,6,S,77,10,S,N,N,N
74 REM ** THAT WAS THE HIT/STAND TABLE
75 REM ** NOW THE DOUBLE DOWN TABLE
80 DATA 10,4,D,9,7,H,A4,4,D,11,9,D,A2,3,H
90 DATA A5,6,D,62,4,H,A7,3,D,11,5,D
100 DATA 10,5,D,9,8,H,A4,3,H,11,10,D,A2,5,D,A6,6,D
110 DATA 53,5,D,A7,4,D,11,6,D
120 DATA 10,6,D,9,3,D,A5,3,H,11,A,D,A2,6,D
130 DATA A6,3,D,62,6,H,A7,5,D,11,7,D
140 DATA 10,7,D,9,4,D,A4,5,D,11,2,D,A3,3,H,A6,4,D
150 DATA 53,3,H,A7,6,D,A2,4,D
160 DATA 10,8,D,9,5,D,A5,4,D,11,3,D,A3,4,D,A6,5,D,62,5,H
170 DATA A8,3,S,A3,5,D
180 DATA 10,9,D,9,2,D,A5,5,D,11,4,D,A3,6,D,A6,2,D
190 DATA 53,6,D,A8,6,D,A4,6,D,N,N,N
195 REM ** NEXT THE PAIR SPLITTING TABLE
200 DATA 99,4,P,44,2,H,77,6,P,66,4,P,22,3,P,33,7,P,99,10,S
210 DATA 99,5,P,44,3,H,77,7,P,66,5,P,22,4,P,33,8,H,99,A,S
220 DATA 99,6,P,44,4,H,77,8,H,66,6,P,22,5,P,33,2,H,99,2,P
230 DATA 99,7,S,44,5,D,77,2,P,66,7,H,22,8,H,33,3,H,99,3,P
240 DATA 99,8,P,44,6,D,77,3,P,66,2,P,22,7,P,33,4,P,AA,A,P
250 DATA 99,9,P,88,10,P,77,9,H,55,8,H,22,2,H
260 DATA 44,7,H,AA,10,P,N,N,N
265 REM ** NOW A BIG PRACTICE TABLE
270 DATA 12,6,S,53,4,H,53,6,D,53,5,D,A7,10,H,44,7,H,62,6,H
280 DATA AA,3,P,12,2,H,12,4,S,16,2,S,12,3,H,13,2,S,12,5,S
290 DATA 14,2,S,A2,4,D,A4,3,H,A2,6,D,A4,5,D,A3,5,D,A2,3,H
300 DATA 10,9,D,73,3,D,64,10,H,55,2,D,82,4,D,73,8,D,64,5,D
310 DATA 44,6,D,AA,9,P,AA,10,P,AA,2,P,AA,8,P,AA,A,P
320 DATA 13,8,H,13,6,S,15,5,S,13,3,S,13,5,S,14,4,S,14,6,S
330 DATA A8,5,S,33,8,H,33,3,H,33,5,P,33,7,P,33,2,H,33,4,P
340 DATA 33,6,P,A6,2,D,A6,6,D,A4,4,D,A6,4,D,A6,5,D,A7,3,D
350 DATA A7,2,S,44,4,H, 62,5,H,44,3,H,44,2,H,88,9,P,44,5,D
360 DATA 13,4,S,16,5,S,14,3,S,14,5,S,15,2,S,15,4,S,15,6,S
370 DATA A4,6,D,55,7,D,83,9,D,74,A,D,82,6,D,73,A,H,A4,2,H
380 DATA 65,7,D,22,4,P,22,6,P,22,8,H,22,5,P,22,3,P,22,7,P
390 DATA 22,2,H,A8,3,S,A3,5,D,A6,3,D,A8,2,S,A8,4,S,A8,6,D
400 DATA 15,3,S,66,6,P,66,7,H,88,10,P,66,3,P,66,5,P,66,2,P
410 DATA 66,4,P,63,4,D,54,8,H,72,3,D,63,5,D,54,2,D,72,7,H
420 DATA 72,6,D,16,8,H,15,7,H,14,8,H,14,7,H,15,8,H,A9,4,S
430 DATA 53,3,H,A3,3,H,A5,6,D,A5,5,D,A3,4,D,A3,6,D,16,7,H
440 DATA A5,4,D,15,10,H,16,4,S,16,10,H,16,6,S,14,10,H,74,2,D
450 DATA 77,2,P,77,4,P,77,6,P,A7,A,S,77,8,H,77,3,P,77,5,P
460 DATA 99,5,P,83,10,D,13,A,H,15,9,H,16,A,H,16,9,H,A5,3,H
470 DATA 15,A,H,14,9,H,74,5,D,65,4,D,92,6,D,83,3,D,16,4,S
480 DATA 92,8,D,99,7,S,99,A,S,99,4,P,99,6,P,99,3,P
490 DATA A9,5,S,A7,6,D,A9,3,S,A7,4,D,A9,6,S
495 DATA 83,A,D
500 DATA A7,5,D,14,A,H,999,999,999
540 REM ** THE PROGRAM STARTS HERE
550 GOSUB 6: SPEED= 100: PRINT "THIS PROGRAM WILL TEACH YOU BLACKJACK STRATEGY"
560 PRINT : PRINT "FIRST A REVEIW OF THE STRATEGY......"
570 HOME : VTAB 5: PRINT " WHAT YOU DO DEPENDS ON THE DEALER'S UP CARD, AND ON YOUR HAND (FIRST 2 CARDS)"
580 PRINT : PRINT " WHEN THE DEALER HAS 7,8,9,10, OR ACE SHOWING"
590 PRINT : PRINT " HIT UNTIL YOU GET 17 OR ABOVE."
598 GOSUB 5
610 HOME : VTAB 5: PRINT "IF THE DEALER HAS 2,3,4,5, OR 6 SHOWING"
620 PRINT : PRINT " YOU STAND IF YOU HAVE 13 OR ABOVE"
630 PRINT : PRINT : PRINT : PRINT " HIT 12 IF DEALER HAS A 2 OR 3"
640 GOSUB 5
650 GOSUB 6: PRINT " NOW I WILL TELL YOU WHEN TO DOUBLE DOWN"
660 PRINT : PRINT : PRINT "DOUBLE DOWN WHEN YOU HAVE 11, ALWAYS!!": PRINT : PRINT
670 PRINT "DOUBLE WHEN YOU HAVE: & THE DEALER HAS:"
680 PRINT : PRINT " 10 ANYTHING EXCEPT 10 OR A 9 2 THROUGH 6"
690 PRINT " 8 (EXCEPT 6,2) 5 OR 6 A2 THROUGH A5 4,5 OR 6 "
700 PRINT " A6 2 THROUGH 6 A7 3 THROUGH 6 A8 6"
715 GOSUB 5
716 GOSUB 6: INVERSE : PRINT " NOTE :";: NORMAL : PRINT " WHEN YOU CAN'T DOUBLE DOWN"
717 PRINT : PRINT "ON YOUR 'SOFT' HANDS. DO AS FOLLOWS:"
718 PRINT : PRINT : PRINT "A2,A3,A4,A5,A6 HIT IF YOU CAN'T DOUBLE"
719 PRINT "A7 STAND IF DEALER HAS 2,7,8, OR A"
720 PRINT : PRINT "A7 HIT IF DEALER HAS 9 OR 10"
721 PRINT : PRINT "A8 STAND"
722 GOSUB 5
724 GOSUB 6: PRINT "NOW I'LL SHOW YOU WHEN TO SPLIT PAIRS": PRINT
725 PRINT : PRINT " ALWAYS SPLIT ACES (AA) AND EIGHTS (88)"
727 PRINT : PRINT " NEVER SPLIT 44, 55, OR 10 10"
730 PRINT : PRINT : PRINT " SPLIT AGAINST DEALER'S CARD"
732 PRINT : PRINT " 22 3 THROUGH 7 33 4 THROUGH 7"
735 PRINT " 66 2 THROUGH 6 77 2 THROUGH 7"
737 PRINT " 99 2 THROUGH 9 (EXCEPT 7)"
740 GOSUB 5: GOSUB 6: PRINT "WHEN YOU PLAY BLACK JACK FOLLOW THE ABOVE RULES ",
745 INVERSE : PRINT " COMPLETELY !! "
747 PRINT : PRINT " D O N ' T FOLLOW HUNCHES ! ! ! "
750 PRINT : PRINT " AND N E V E R TAKE INSURANCE ! ! ! ": NORMAL : GOSUB 5
751 GOSUB 6: PRINT " DO YOU WANT TO REVIEW THE RULES (Y/N)?": GOSUB 10: IF NUM = 217 THEN 550
765 GOSUB 6: PRINT " NOW FOR THE HARD PART...!!"
810 PRINT : INPUT "ENTER A NUMBER BETWEEN 1 AND 50";R: IF R <1 OR R >50 THEN PRINT "TRY AGAIN!!": GOTO 810
825 REM ** R IS USED TO INITIALIZE THE RANDOM # GENERATOR
830 HOME : VTAB 2: PRINT " ANSWER AS FOLLOWS: ": PRINT
840 PRINT " 'H' = HIT 'S' = STAND 'D' = DOUBLE DOWN 'P' = SPLIT PAIRS 'T' = TELL ME 'R' = RULES 'B' = 'BYE' IF YOU WANT TO STOP"
850 PRINT : PRINT "YOUR HAND","DEALER SHOWS","YOU PLAY"
860 POKE 34,10
2000 REM ** RANDOMIZE INDEX **
2001 FOR I = 1 TO R:Z = RND(0): NEXT
2020 FOR I = 1 TO 20:X(I) = I: NEXT
2025 REM ** THE QUESTIONS ARE ASKED IN GROUPS OF 20 AND RANDOMIZED WITHIN THAT GROUP. THEREFORE EVERY RUN IS DIFFERENT
2030 FOR J = 1 TO 19
2040 Y = INT( RND(1) *(21 -J)) +J
2050 T = X(J):X(J) = X(Y):X(Y) = T
2060 NEXT
2500 FOR L = 1 TO 20
2502 REM ** A$(L) = PLAYERS HAND
2504 REM ** B$(L) = DEALER'S UP CARD
2506 REM ** C$(L) = CORRECT PLAY
2510 READ A$(L),B$(L),C$(L)
2515 REM ** COMING TO THE END OF THE TABLE ?
2520 IF A$(L) = "N" THEN M = L -1: GOTO 6000
2525 REM ** COMING TO THE END OF ALL TABLES ?
2530 IF A$(L) = "999" THEN 6000
2560 NEXT
3000 FOR I = 1 TO 20
3010 M = X(I)
3040 HOME : PRINT TAB( 6)A$(M),B$(M),"? ";: GOSUB 10:Q$ = CHR$(NUM -128): PRINT Q$
3050 IF Q$ = "B" THEN 9000
3055 IF Q$ = "R" THEN TEXT : SPEED= 255: GOTO 560
3060 IF Q$ = "T" THEN 3100
3070 IF Q$ = C$(M) THEN 3120
3080 PRINT : PRINT "WITH ";A$(M);" VS ";B$(M);" YOU ";C$(M)
3090 GOSUB 12: GOTO 3040
3099 REM ** TELL THE ANSWER
3100 PRINT : PRINT " THE ANSWER IS '";C$(M);"'": GOSUB 12
3110 GOTO 3040
3120 NEXT
6000 FOR J = 1 TO M
6005 IF A$(J) = "999" THEN 9000
6010 HOME : PRINT TAB( 6)A$(J),B$(J),"? ";: GOSUB 10:Q$ = CHR$(NUM -128): PRINT Q$
6020 IF Q$ = "B" THEN 9000
6025 IF Q$ = "R" THEN 3055
6030 IF Q$ = "T" THEN 6070
6040 IF Q$ = C$(J) THEN 6090
6050 PRINT : PRINT " NOPE, IT IS ";C$(J)
6060 GOSUB 12: GOTO 6010
6070 PRINT : PRINT " THE ANSWER IS ";C$(J)
6080 GOSUB 12: GOTO 6010
6090 NEXT
6100 PRINT : PRINT " VERY GOOD ... ON TO THE NEXT TABLE"
6110 GOTO 2500
9000 TEXT : SPEED= 100: GOSUB 6: PRINT "THAT WAS GOOD! IF YOU ARE READY FOR SOME MORE TYPE 'RUN' ...ANYTIME!"
9010 FLASH : PRINT : PRINT : PRINT " I ONLY WANT 10 % OF YOUR WINNINGS ! ! !": NORMAL : PRINT : PRINT " THAT'S REASONABLE, ISN'T IT ?"
9910 SPEED= 255
9999 END